package cn.kailangtu.serialutils.api;

import cn.kailangtu.commontools.AppVariable;

public class Com2 extends ComBase {
    private static Com2 instance;

    public static Com2 getInstance(){
        if(instance == null)
        {
            instance = new Com2();
        }
        return instance;
    }

    private Com2(){
        address = 2;
    }

    public  void setParams(int baudrate, int flags ){
        byte[] data = new byte[] {getBaudrateByte(baudrate), (byte)(flags & 0xFF)};
        DataVersion2 dataVersion2 =   DataVersion2.build(102,data);
        if(AppVariable.platform_version == 450)
        {
           // SerialPortApi485.getInstance().addSendString(dataVersion2.getCmdString());
        }
        else {
            SerialPortApi.getInstance().addSendString(dataVersion2.getCmdString());
        }
    }
}
